<template>
  <div class="swiper">
    <swiper :options="swiperOption">
      <swiper-slide v-for="item of swiperList" :key="item.id">
        <img :src="item.imgUrl" />
      </swiper-slide>
      <div class="swiper-pagination"  slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
export default {
  props: ['swiperList'],
  data () {
    return {
      swiperOption: {
        pagination: {
          el: '.swiper-pagination'
        },
        loop: true,
        autoplay: {
          delay: 15000,
          stopOnLastSlide: false,
          disableOnInteraction: false
        }
      }
    }
  }
}
</script>

<style scoped>
  .swiper {
    width: 100%;
    height: 0;
    background-color: #eee;
    padding-bottom: 26.6666%;
  }
  .swiper img {
    width: 100%;
    height: 100%;
  }
  .swiper >>> .swiper-pagination-bullet-active {
    background: #fff;
  }
  .swiper >>> .swiper-pagination-bullet {
    width: 6px;
    height: 6px;
  }
</style>
